<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="layout/online">
<head>
    <title>Add Topic</title>
</head>
<body>
    <main layout:fragment="content">
        <article class="container" style="padding: 3% 0 2%;">
            <header class="row">
                <div class="col s12">
                    <blockquote class="flow-text left" th:text="|选择一个目录并创建相应的话题： |">Add topic</blockquote>
                </div>
            </header>
            <section>
                <form th:action="@{/addTopic}" method="post">
                    <div class="row">
                        <div class="col s12">
                            <p>
                                <input value="se" name="category" class="with-gap" type="radio" id="se" required="required"/>
                                <label for="se">Java Standard Edition</label>
                            </p>
                            <p>
                                <input value="ee" name="category" class="with-gap" type="radio" id="ee" required="required"/>
                                <label for="ee">Java Enterprise Edition</label>
                            </p>
                            <p>
                                <input value="mbs" name="category" class="with-gap" type="radio" id="mbs" required="required"/>
                                <label for="mbs">MyBatis</label>
                            </p>
                            <p>
                                <input value="spring" name="category" class="with-gap" type="radio" id="spring" required="required"/>
                                <label for="spring">Spring Framework</label>
                            </p>
                            <p>
                                <input value="web" name="category" class="with-gap" type="radio" id="web" required="required"/>
                                <label for="web">HTML/CSS/JavaScript</label>
                            </p>
                            <p>
                            		<input value="other" name="category" class="with-gap" type="radio" id="other" required="required"/>
                                <label for="other">其他</label>
                            </p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col s12">
                            <label>Title:
                                <input type="text" name="title" maxlength="32" data-length="32" required="required"/>
                            </label>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col s12">
                            <label>Content:
                            		<textarea name="content" class="materialize-textarea" maxlength="1024" data-length="1024" required="required"></textarea>
                            </label>
                        </div>
                    </div>

				<div class="row">
                        <div class="col s12">
                            <label>Code:
                                <textarea name="code" class="materialize-textarea" placeholder="[optional]"
                                          style="font-family: monospace, monospace;" maxlength="1024" data-length="1024"></textarea>
                            </label>
                        </div>
                    </div>
                    <input type="hidden" name="id_user" th:value="${user.getId()}"/>
                    <div class="row">
                        <div class="col s12 center">
                            <button class="btn waves-effect waves-light btn-large" type="submit" name="add">发表</button>
                        </div>
                    </div>
                </form>
            </section>
        </article>
    </main>
</body>
</html>